<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::any('/refuse',['as'=>'refuse',function(){
    return response()->json([
        'code'	=>'10002',
        'msg'	=>'权限验证失败',
        'data'	=> ''
    ]);
}]);



//Route::get('/app/test','uses'=>'IndexController@test');


Route::any('/index/getmenu','IndexController@getmenu');
Route::any('/index/getmenu2','IndexController@getmenu2');

Route::any('/index/goodslist','IndexController@goodslist');
Route::any('/index/goodsdetails','IndexController@goodsDetails');


Route::group(['middleware' => ['wxauth']], function () {

	//购物车
	Route::any('/cart/cartlist','CartController@cartList');
	Route::any('/cart/add','CartController@add');
	Route::any('/cart/cartdel','CartController@cartDel');
	Route::any('/cart/setcartnum','CartController@setCartNum');
	Route::any('/cart/setselected','CartController@setSelected');
	Route::any('/cart/cartselected','CartController@cartSelected');
	Route::any('/cart/goodspay','CartController@goodspay');
	//订单
	Route::any('/order/goodspay','OrderController@goodspay');
	Route::any('/order/cartpay','OrderController@cartpay');
	Route::any('/order/orderlist','OrderController@orderList');
	Route::any('/order/orderdetails','OrderController@orderDetails');
	Route::any('/order/ordercancel','OrderController@orderCancel');
    
	
});


//微信登陆
Route::any('/login/login','LoginController@login');
